/**
 * Created by mapbar_front on 2019/8/11.
 */
import React,{Component} from 'react';

class Mouse extends Component{
    constructor(props){
        super(props);
        this.state = {
            x:0,
            y:0,
        }
    }
    mouseMove=(event)=>{
        this.setState({
            x: event.clientX,
            y: event.clientY,
        })
    }
    render(){
        return(
            <div onMouseMove={this.mouseMove}>
                <h1>移动鼠标！</h1>
                <p>X:{this.state.x}</p>
                <p>Y:{this.state.y}</p>
            </div>
        )
    }
}
export default Mouse;
